package com.zzl.admin.utils;

import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * description: redis工具类
 * @author 朱正磊
 * @date 2022-02-07 14:51:33
 */
@Component
public class RedisTool {

    @Resource
    private StringRedisTemplate stringRedisTemplate;

    /**
     * description: 发布消息
     * @author 朱正磊
     * @date 2022-02-07 14:54:00
     * @param key 键
     * @param value 值
     */
    public void publish(String key, String value) {
        stringRedisTemplate.convertAndSend(key, value);
    }

}
